#ifndef EDGE_H
#define EDGE_H

#include <QString>
#include <QGraphicsObject>
#include <QPainter>
#include <math.h>

#include <QtGui>

class Node;
class Graph;

class Edge : public QGraphicsObject
{
   Q_OBJECT
public:
    Edge(Node* sourceNode, Node* destNode, Graph *graph );
    ~Edge();

    Node *getSourceNode() const;
    Node *getDestNode() const;

    void adjust();

protected:
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

private:
    Node *source, *dest;
    qreal arrowSize;
    QPointF sourcePoint;
    QPointF destPoint;
    Graph *graph;
};

#endif // EDGE_H
